/* ----------------------------------------------------------------------------
 * The materials provided here are for sample use and are provided "as-is";
 * Oracle disclaims all express and implied warranties, including, the implied
 * warranties of merchantability or fitness for a particular use. Oracle shall
 * not be liable for any damages, including, direct, indirect, incidental,
 * special or consequential damages for loss of profits, revenue, data or data
 * use, incurred by you or any third party in connection with the use of these
 * materials.
 *
 * DESCRIPTION  The class that launches internet connection using CE's ConnectionManage
 * ---------------------------------------------------------------------- */

#ifndef __CONNMANAGER_H__
#define __CONNMANAGER_H__

#pragma warning(disable : 4201)
#include <windows.h>
#pragma warning(default : 4201)
#include <connmgr.h>
#include "AutoHelper.h"

// ************************************************************
// Class CConnManager - the class that manages connection
// ************************************************************

class CConnManager
{
	friend class CFreeObject<CConnManager>;

public:
	static CConnManager* GetInstance();
	HRESULT ConnectWithConnMgr(const GUID* pGuid, HANDLE* phConnHandle);
	HRESULT ReleaseConnection(HANDLE hConnHandle);

protected:
	CConnManager();
	~CConnManager();

private:
	static CFreeObject<CConnManager> m_pInstance;
};

#endif
